package org.solon.demo.controller;

import org.noear.solon.annotation.Body;
import org.noear.solon.annotation.Controller;
import org.noear.solon.annotation.Get;
import org.noear.solon.annotation.Mapping;
import org.noear.solon.annotation.Post;
import org.noear.solon.core.handle.Result;
import org.solon.demo.controller.param.AddressParam;

/**
 * 地址接口
 */
@Controller
@Mapping("address")
public class AddressController {
    /**
     * 添加地址
     *
     * @param addressParam
     * @return
     * @apiNote 根据表单内容新建地址
     */
    @Post
    @Mapping("add")
    public Result<Long> add(@Body AddressParam addressParam) {
        System.out.println(addressParam);
        return Result.succeed(System.currentTimeMillis());
    }


    /**
     * 添加地址
     *
     * @param id id|111
     * @apiNote 根据表单内容新建地址
     */
    @Get
    @Mapping("get")
    public Result<AddressParam> get(Long id) {
        System.out.println(id);
        return Result.succeed(new AddressParam());
    }

}
